package com.ruoyi.yljf.domain;

import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.yljf.domain.dto.CreateDTO.RecordCreateDTO;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BasePlusEntity;

/**
 * 学习记录对象 yljf_record
 * 
 * @author TAT
 * @date 2025-03-10
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "yljf_record")
public class Record   {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /** 主键id */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 总时长（总题数） */
    @Excel(name = "总时长", readConverterExp = "总=题数")
    private Long totalTime;

    /** 停止时间（关闭时间/关闭题目的序号） */
    @Excel(name = "停止时间", readConverterExp = "关=闭时间/关闭题目的序号")
    private Long offTime;

    /** 课程id */
    @Excel(name = "课程id")
    private Long courseId;

    /** 进度 */
    @Excel(name = "进度")
    private String progress;

    /** 章节id */
    @Excel(name = "章节id")
    private Long sectionId;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 记录类型（课程视频、音频、电子书、练习、考试） */
    @Excel(name = "记录类型", readConverterExp = "课=程视频、音频、电子书、练习、考试")
    private String type;

    public Record (RecordCreateDTO dto){
        BeanUtils.copyProperties(dto, this);
    }

}
